package com.menker.app.rest.result;

import android.app.Activity;
import android.content.Context;

import com.menker.app.common.Utils;
import com.menker.app.util.IntentUtils;


/**
 * @author J.Huang
 * @version 1.0
 *
 */

public class ApiResult {
    public int ErrorCode;
    public String ErrorMessage;

    public boolean checkState(Activity activity) {
        switch (ErrorCode) {
            case 0:
                return true;
            case 400001:
                Utils.UI.showToastLong("用户在其他设备登录或登录信息过期\n请重新登录!");
                IntentUtils.toLogin(activity);
                break;
            case 500101:
//                Intent intent = new Intent();
//                intent.setClass(context, FillInfoActivity_.class);
//                intent.putExtra(LoginResult.EXTRA_NAME, Parcels.wrap(mThirdLoginUserInfo));
//                context.startActivity(intent);
            default:
                Utils.UI.showToastShort(ErrorMessage);
                break;
        }
        return false;
    }
}
